#include <stdio.h>
#include <math.h> 
int main()
{
	int n = 0;
	int a = 0, b = 0, c = 0;
	int cnt = 0;
	scanf("%d", &n);
	for ( int i = 0; i < n; i++ ) {
		scanf("%d %d %d", &a, &b, &c);
		if ( a * a + b * b == c*c) {
			cnt ++;
		}
	}
	printf("%d", cnt);
	return 0;
}

